package cool.qingqing.service;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.lang.Nullable;

/**
 * @author 高山青
 * @Date 2021/12/30  -   12:36
 */

public class MyBeanPost implements BeanPostProcessor {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		System.out.println("在初始化之前执行");
		return bean;
	}

	public void init(){
		System.out.println("有点了解了开始吧！");
	}

	public void end(){
		System.out.println("有点了解了结束吧！");
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		System.out.println("在初始化之后执行");
		return bean;
	}
}
